<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>

<script>
    //es5
    const person = {
        //放 键值对
        name:"Shane",
        age:18,
        run:function(){
            console.log("Shane is running");
        }
    }

    //es6 简写
    let name = 'Kitty'
    const person2 = {
        name,
        age:15,
        run(){
            console.log();
        },
        walk(){
            console.log();
        }
    }

    //对象的属性是可以通过表达式创建的
    obj1 = {
        [name+'Newname']:'Amy',
        [name+'Newage']:12

    }
    console.log(obj1);

    //扩展符号...
    obj = {name:'tom'}
    obj2 = {
        run(){
            console.log();
        }
    }

    //Object.assign()将对象复制到目标对象中，往里添加属性
    

    //对象的合并
    console.log(...obj,...obj);

</script>

</html>